(define (fast-expt b n)
        (fast-expt-iter b 1 n b)
)
(define (fast-expt-iter product a n b)
        (if (< n 1) 
            product
            (if (< (* a 2 ) n)
                (fast-expt-iter (* product product)
                                (* 2 a)
                                n
                                b
                )
                (* product 
                   (fast-expt-iter b 1 (- n a) b)
                )                 
            )
        )
)
(display (fast-expt 2 9))
(exit)